package cn.diancan.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;

import cn.diancan.util.DateUtil;

@Entity
@Table(name="Color",uniqueConstraints = {@UniqueConstraint(columnNames={"colorNumber"})}) 
public class Color {
    
    private Long id;
    
    private String colorNumber;
    private String colorName;
    private String colorGroupNumber;
    
    private String createTime;
    private Integer isDelete;
    private Integer version;
    
    @Version
    @Column(name="OPTLOCK",columnDefinition="int(11) DEFAULT 0")
    public Integer getVersion() {
        return version;
    }
    public void setVersion(Integer version) {
        this.version = version;
    }
    
    @Id
    @GeneratedValue
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    @Column(columnDefinition="VARCHAR(10)")
    public String getColorNumber() {
        return colorNumber;
    }
    public void setColorNumber(String colorNumber) {
        this.colorNumber = colorNumber;
    }
    @Column(columnDefinition="VARCHAR(50)")
    public String getColorName() {
        return colorName;
    }
    public void setColorName(String colorName) {
        this.colorName = colorName;
    }
    @Column(columnDefinition="VARCHAR(10)")
    public String getColorGroupNumber() {
        return colorGroupNumber;
    }
    public void setColorGroupNumber(String colorGroupNumber) {
        this.colorGroupNumber = colorGroupNumber;
    }
    @Column(name="createTime",columnDefinition="DATETIME")
    public String getCreateTime() {
	return DateUtil.getMysqlDateTime(createTime);
    }
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
    public Integer getIsDelete() {
        return isDelete;
    }
    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }
    
    
    
    
    
    

}
